<html>
<head>
<title>WIKINDX DOCUMENTATION</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/wikindx2/docs/docs.css" type="text/css" />
</head>

<body bgcolor="#FFFFFF" text="#000000">
<h2>WIKINDX ~ Coding conventions for version 2</h2>
<p>With more than one developer, a coding convention is required to 
aid in readability and understanding. This relates to the naming of variables, 
functions and <a href="classes/index.html">classes and methods</a> in 
addition to <a href="structure.html">structural matters</a>.</p>
<p><em>All PHP code must be compatible with PHP >= v4.3.10 as this, currently, seems to be the most common PHP install. This may change in future now that PHP 5 is out.</em>
<p>
<h4>NAMING REQUIREMENTS:</h4>
<p>1/ All variables and functions/methods must be a mix of lower and upper case, 
should be designed to be self-documenting and will scan in English (usually 
starting with a verb). For example, a class method that grabs the resource's 
title from the database should be named something like:<br />     
<pre>
	getResourceTitle()
and not
	resourceTitleGet() (doesn't scan in English)
or
	grabTitle() (has only a partial sense)
or
	get_resource_title() (unnecessary length)
or
	fuchsia() (means nothing)</pre><br />

Variables that can be exceptions to this are:<br />
a) transitory and throwaway variables as you might find briefly used in for() 
loops and<br />
b) WIKINDX configuration variables which must be uppercase, start with 
$WIKINDX_ and have a descriptive name.<br />
For example:<br />
<pre>
	$WIKINDX_DB_PASSWORD
and not
	$WIKINDX_PWDDB</pre>
</p>
<p>
2/ All WIKINDX classes must be uppercase (for example SQL.php), while 
non-class PHP files must be lowercase (for example index.php). Within a class, 
the class name (one only) and constructor name will be uppercase. For example, 
SQL.php will have a SQL{} class and, within that, a SQL{} constructor.
</p>
<p>
3/ Groups of classes having a common theme are placed in a descriptive 
lowercased folder within the classes folder.
</p>
<p>4/ When including files use the full path. Some ISP configurations will not find the include file without it. e.g.</p>
<pre>
	include_once("core/sql/adodb.inc.php");
	and not
	include_once(adodb.inc.php");
</pre>
<p><strong>Comment your code!</strong></p>
<p align="right"><a href="index.html">WIKINDX home</a></p>
</body>
</html>
